// 封装localstorage
const localStorage = window.localStorage
const db = {
  set:(key,value)=>{
    localStorage.setItem(key, JSON.stringify(value))
  },

  get:(key)=>{
    return JSON.parse(localStorage.getItem(key))||''
  },

  del:(key) => {
    localStorage.removeItem(key)
  },
  clear:() => {
    localStorage.clear()
  }

}

export default db